#include <iostream>
#include <cstring>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <bitset>
#include <utility>
using namespace std;

#define mm(a, n) memset(a, n, sizeof a)
#define mk(a, b) make_pair(a, b)

const double eps = 1e-6;
const int INF = 0x3f3f3f3f;

typedef long long LL;
typedef unsigned long long ULL;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef pair<int, LL> PIL;

// 数位统计问题：数位化、数位DP
inline void quickread() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
}

int count(int n) {
    vector<int> nums;
    while (n) nums.push_back(n % 10), n /= 10;
    
    int res = 0;
    for (int i = nums.size() - 1; i >= 0; i -- ) {
        int d = nums[i];
        int left = 0, right = 0, power = 1;
        for (int j = nums.size() - 1; j > i; j -- ) left = left * 10 + nums[j];
        for (int j = i - 1; j >= 0; j -- ) {
            right = right * 10 + nums[j];
            power *= 10;
        }
        if (d == 0) res += left * power;
        else if (d == 1) res += left * power + right + 1;
        else res += (left + 1) * power;

    }
    return res;
}

inline void solution() {
    int a;
    cin >> a;
    cout << count(a)<< endl;
    return ;
}

int main() {
    freopen("input.txt", "r", stdin);
    quickread();
    solution();
    return 0;
}